package demo2;

public class test {




    //Comparable

    public static void main1(String[] args) {
        Student stu1=new Student(5,"Psh",78.3);
        Student  stu2=new Student(12,"dhw",88.8);

//        if(stu1.compareTo(stu2)>0){
//            System.out.println("stu1>stu2");
//        } else if (stu1.compareTo(stu2)<0) {
//            System.out.println("stu1<stu2");
//
//        }
//        else{
//            System.out.println("stu1=stu2");
//
//        }



    }


    //2.comparator
    public static void main(String[] args) {

        Student stu1=new Student(5,"Psh",78.3);
        Student  stu2=new Student(12,"dhw",88.8);
        agecomparator agecom=new agecomparator();
//        if(agecom.compare(stu1,stu2)>0){
//            System.out.println("stu1>stu2");
//        }else{
//            System.out.println("stu1<stu2");
//        }
        //————————————————————————————————————————————————————————————————
        namecomparator namecom=new namecomparator();
        if(namecom.compare(stu1,stu2)>0){
            System.out.println("stu1>stu2");

        }
        else{
            System.out.println("stu1<stu2");
        }
        //————————————————————————————————————————————————————————————————————————



    }



}
